package com.banmao.CarlCamp.Day07;

/**
 * https://leetcode.cn/problems/reverse-string/
 */
public class LC344 {

    public void reverseString(char[] s) {
        // 倒是简单，双指针
        if (s.length == 0 || s.length == 1) {
            return;
        }

        int left = 0, right = s.length - 1;
        while (left < right) {
            char temp = s[left];
            s[left] = s[right];
            s[right] = temp;
            left++;
            right--;
        }

    }

}
